Java code: [/B] [Code]/**
* Obtain the CPU serial number
*
* @ Return CPU serial number (16 bits)
* Failed to read: "0000000000000000"
*/
Public static string getcpuserial (){
String STR = "", strcpu = "", cpuaddress = "0000000000000000 ";
Try {
// Read CPU Information
Process pp = runtime.getruntime(cmd.exe C ("
Turn from: http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=124threadID=28320messageID=171767
Java obtains the CPU serial number and the network card MAC address
/*
Using the commands of the runtime call operating system, the specific commands depend on the different operating systems, and do not invoke the Runtime.getruntime (). EXEC (String) interface to use Runtime.getruntime (). EXEC ( String[]) This i
Public static string getcpuserial (){String STR = "", strcpu = "", cpuaddress = "0000000000000000 ";Try {// Read CPU InformationProcess pp = runtime.getruntime(cmd.exe C ("cat/proc/cpuinfo ");Inputstreamreader IR = new inputstreamreader (pp. getinputstream ());Linenumberreader input = new linenumberreader (IR );// Search for the CPU serial numberFor (INT I = 1; I STR = input. Readline ();If (STR! = NULL ){/
)[^]: matches any single character outside the specified range[[: Alpha:]]*[[:space:]]*[[:alpha:]]: Get a file that starts with a letter, ends with a letter, and has spaces in the middle[[: Alpha:]]*[[:space:]]*[^[:alpha:]]: Get a file that starts with a letter, does not end with a letter, and has spaces in the middlePractice:1, create A123, Cd6, c78m, C1 My, m.z, K, 8yu, 789 and other documents; Note that the above files are separated by commas, and the other symbols are part of the file name;2
: Timestamp for modifying a file-A: Change access time only-M: Change the modification time only-T: Specify the time of the file to a certain time (change the file's modification time to a certain time in the past: Touch–m–t file name)-C,--no-creat: Do not create any filesAccess: Accessing TimeModify: Modification TimeChange: Changing Time# Stat: Displays status information for a file or file systemTo create a file, you can use the file editor (a Linux-brought text editor: Nano)RM: Deleting file
, awk cut: Cut files-D: Specifies the field delimiter, which is the default space-F: Specify the fields to display-F 1, 3: Show First and three fields-F 1-3: Show first to third field Sort: Text sort (default is sorted by ASCII code in ascending order)-N: Sort by numeric size-r: Sort by ASCII code descending-T: Field delimiter-K: Which field to sort the keywords for (sort-t:-K3/ETC/PASSWD)-U: The same row is only displayed once after sorting-F: Ignore character capitalization when sorting uni
Obtain the COM port number mapped to the serial port
Background: Recently, due to project requirements, you need to operate the SMS cat. After the SMS cat is inserted into the computer, it will map the COM port based on the current PC status. Here, you need to dynamically obtain the COM port mapped by the SMS
Tags: col IP add shell script GRE ide MAC address = = Pre Cat#!/bin/Bashinterface=`ls/sys/class/net|grepen|awk 'Nr==1{print}'`if[!-e/etc/adserver/.seq.Info]; Then#生成序列号 #时间 #d=`Date+%y%m%d 'mkdir/etc/adserver/D= ' Dmidecode-t0|grep-op'(? '|awk-F':' 'nr==1'|awk-F'/' '{print $3$1$2}'' #批次lot=' on'#mac地址 mac= ' IP addr Show $interface |grep-op'(? '|sed-N'S/://GP'` seq='AD001'$d $lot$macEcho$seq>/etc/adserver/.seq.Info Echo$seqElse
' '-F1--implements the Cat/etc/passwd | WC-L--displays the number of rows in the directory LS/usr/bin | Wc-lAfter-school assignments:Practice:1. Statistical/usr/bin/the number of files in the directory;#Ls/usr/bin | wc-l2, the shell of all the users on the current system is removed, and each shell is displayed only once, and is displayed sequentially;#cut-d:-f7/e
After debugging multiple mobile phones in the company, two mobile phones are connected to the computer through USB at the same time for comparison. Suddenly I found that the serial numbers of the two mobile phones were identical when I used the ADB devices command. Because this is the same machine in the company .... This makes it impossible to connect at the same time.
Apuser @ yaochuanliubt :~ /Mywork/4.1-3.4/kernel/ARCH/ARM/configs $ ADB DevicesLis
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.